let wFile = require('./modules/wFile');
function getRecall(req,res){
    res.writeHead(200,{'Content-Type':'text/html;charset=utf-8'});
    function recall(data){
        res.write(data);
        res.end('');
    }
    return recall;
}
module.exports ={
    writefile:function (req,res){
        function recall(data){
            res.write(data);
            res.end('');
        };
        wFile.writefileFunc('./modules/staticFile.txt','沉默的大多数',recall);
    },
    showImg:function(req,res){
        res.writeHead(200,{'Content-Type':'image/jpeg'});
        wFile.readImg('./imgs/pic.jpg',res);
    },
    login:(req,res)=>{
     recallFunc = getRecall(req,res);
     wFile.readfileFunc('./views/login.html',recallFunc);
    }
} 